package com.itkang.decorate;

/**
 * <p>
 * 场景:
 * </p>
 *
 * @author york yuan
 * @version 1.0
 * @since 15/7/8下午3:22
 */
public class Main {
    public static void main(String[] args) {
        //创建一个需要装饰的对象
        Beverage beverage = new Espresso();
        System.out.println(beverage.getDescription() +   "  $" + beverage.cost());

        //进行装饰,并查看装饰结果
        beverage = new Soy(beverage);
        System.out.println(beverage.getDescription() +   "  $" + beverage.cost());


        beverage = new HouseBlend();
        beverage = new Mocha(beverage);
        System.out.println(beverage.getDescription() +   "  $" + beverage.cost());

        beverage = new Soy(beverage);
        System.out.println(beverage.getDescription() +   "  $" + beverage.cost());


    }
}
